package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerAttendanceSummaryMapper;
import com.traffic.domain.PerAttendanceSummary;
import com.traffic.service.IPerAttendanceSummaryService;

/**
 * 出勤汇总Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerAttendanceSummaryServiceImpl implements IPerAttendanceSummaryService 
{
    @Autowired
    private PerAttendanceSummaryMapper perAttendanceSummaryMapper;

    /**
     * 查询出勤汇总
     * 
     * @param attendanceId 出勤汇总主键
     * @return 出勤汇总
     */
    @Override
    public PerAttendanceSummary selectPerAttendanceSummaryByAttendanceId(Long attendanceId)
    {
        return perAttendanceSummaryMapper.selectPerAttendanceSummaryByAttendanceId(attendanceId);
    }

    /**
     * 查询出勤汇总列表
     * 
     * @param perAttendanceSummary 出勤汇总
     * @return 出勤汇总
     */
    @Override
    public List<PerAttendanceSummary> selectPerAttendanceSummaryList(PerAttendanceSummary perAttendanceSummary)
    {
        return perAttendanceSummaryMapper.selectPerAttendanceSummaryList(perAttendanceSummary);
    }

    /**
     * 新增出勤汇总
     * 
     * @param perAttendanceSummary 出勤汇总
     * @return 结果
     */
    @Override
    public int insertPerAttendanceSummary(PerAttendanceSummary perAttendanceSummary)
    {
        return perAttendanceSummaryMapper.insertPerAttendanceSummary(perAttendanceSummary);
    }

    /**
     * 修改出勤汇总
     * 
     * @param perAttendanceSummary 出勤汇总
     * @return 结果
     */
    @Override
    public int updatePerAttendanceSummary(PerAttendanceSummary perAttendanceSummary)
    {
        perAttendanceSummary.setUpdateTime(DateUtils.getNowDate());
        return perAttendanceSummaryMapper.updatePerAttendanceSummary(perAttendanceSummary);
    }

    /**
     * 批量删除出勤汇总
     * 
     * @param attendanceIds 需要删除的出勤汇总主键
     * @return 结果
     */
    @Override
    public int deletePerAttendanceSummaryByAttendanceIds(Long[] attendanceIds)
    {
        return perAttendanceSummaryMapper.deletePerAttendanceSummaryByAttendanceIds(attendanceIds);
    }

    /**
     * 删除出勤汇总信息
     * 
     * @param attendanceId 出勤汇总主键
     * @return 结果
     */
    @Override
    public int deletePerAttendanceSummaryByAttendanceId(Long attendanceId)
    {
        return perAttendanceSummaryMapper.deletePerAttendanceSummaryByAttendanceId(attendanceId);
    }
}
